home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / ColorSync 2.1.2 GM / Interfaces / PInterfaces / CMApplication.p < prev    next >
Encoding:
Text File  |  1997-02-18  |  33.4 KB  |  1,016 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMApplication.p
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    ColorSync 2.1
  7.  
  8.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  9.                  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT CMApplication;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CMAPPLICATION__}
  28. {$SETC __CMAPPLICATION__ := 1}
  29.  
  30. {$I+}
  31. {$SETC CMApplicationIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QUICKDRAW__}
  38. {$I Quickdraw.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __FILES__}
  41. {$I Files.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __PRINTING__}
  44. {$I Printing.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __CMICCPROFILE__}
  47. {$I CMICCProfile.p}
  48. {$ENDC}
  49.  
  50. {$PUSH}
  51. {$ALIGN MAC68K}
  52. {$LibExport+}
  53.  
  54. CONST
  55.     gestaltColorSync20            = $0200;
  56.     gestaltColorSync21            = $0210;
  57.  
  58.     kDefaultCMMSignature        = 'appl';
  59.     
  60. {  Macintosh 68K trap word  }
  61.     cmTrap                        = $ABEE;
  62.     
  63. {  PicComment IDs  }
  64.     cmBeginProfile                = 220;
  65.     cmEndProfile                = 221;
  66.     cmEnableMatching            = 222;
  67.     cmDisableMatching            = 223;
  68.     cmComment                    = 224;
  69. {  PicComment selectors for cmComment  }
  70.     cmBeginProfileSel            = 0;
  71.     cmContinueProfileSel        = 1;
  72.     cmEndProfileSel                = 2;
  73.     cmProfileIdentifierSel        = 3;
  74. {  Defines for version 1.0 CMProfileSearchRecord.fieldMask  }
  75.     cmMatchCMMType                = $00000001;
  76.     cmMatchApplProfileVersion    = $00000002;
  77.     cmMatchDataType                = $00000004;
  78.     cmMatchDeviceType            = $00000008;
  79.     cmMatchDeviceManufacturer    = $00000010;
  80.     cmMatchDeviceModel            = $00000020;
  81.     cmMatchDeviceAttributes        = $00000040;
  82.     cmMatchFlags                = $00000080;
  83.     cmMatchOptions                = $00000100;
  84.     cmMatchWhite                = $00000200;
  85.     cmMatchBlack                = $00000400;
  86. {  Defines for version 2.0 CMSearchRecord.searchMask  }
  87.     cmMatchAnyProfile            = $00000000;
  88.     cmMatchProfileCMMType        = $00000001;
  89.     cmMatchProfileClass            = $00000002;
  90.     cmMatchDataColorSpace        = $00000004;
  91.     cmMatchProfileConnectionSpace = $00000008;
  92.     cmMatchManufacturer            = $00000010;
  93.     cmMatchModel                = $00000020;
  94.     cmMatchAttributes            = $00000040;
  95.     cmMatchProfileFlags            = $00000080;
  96. {  Result codes  }
  97.                                                                 {  General Errors  }
  98.     cmProfileError                = -170;
  99.     cmMethodError                = -171;
  100.     cmMethodNotFound            = -175;                            {  CMM not present  }
  101.     cmProfileNotFound            = -176;                            {  Responder error  }
  102.     cmProfilesIdentical            = -177;                            {  Profiles the same  }
  103.     cmCantConcatenateError        = -178;                            {  Profile can't be concatenated  }
  104.     cmCantXYZ                    = -179;                            {  CMM cant handle XYZ space  }
  105.     cmCantDeleteProfile            = -180;                            {  Responder error  }
  106.     cmUnsupportedDataType        = -181;                            {  Responder error  }
  107.     cmNoCurrentProfile            = -182;                            {  Responder error  }
  108.                                                                 {  Profile Access Errors  }
  109.     cmElementTagNotFound        = -4200;
  110.     cmIndexRangeErr                = -4201;                        {  Tag index out of range  }
  111.     cmCantDeleteElement            = -4202;
  112.     cmFatalProfileErr            = -4203;
  113.     cmInvalidProfile            = -4204;                        {  A Profile must contain a 'cs1 ' tag to be valid  }
  114.     cmInvalidProfileLocation    = -4205;                        {  Operation not supported for this profile location  }
  115.     cmCantCopyModifiedV1Profile    = -4215;                        {  Illegal to copy version 1 profiles that have been modified  }
  116.                                                                 {  Profile Search Errors  }
  117.     cmInvalidSearch                = -4206;                        {  Bad Search Handle  }
  118.     cmSearchError                = -4207;
  119.     cmErrIncompatibleProfile    = -4208;                        {  Other ColorSync Errors  }
  120.     cmInvalidColorSpace            = -4209;                        {  Profile colorspace does not match bitmap type  }
  121.     cmInvalidSrcMap                = -4210;                        {  Source pix/bit map was invalid  }
  122.     cmInvalidDstMap                = -4211;                        {  Destination pix/bit map was invalid  }
  123.     cmNoGDevicesError            = -4212;                        {  Begin/End Matching -- no gdevices available  }
  124.     cmInvalidProfileComment        = -4213;                        {  Bad Profile comment during drawpicture  }
  125.     cmRangeOverFlow                = -4214;                        {  Color conversion warning that some output color values over/underflowed and were clipped  }
  126.     cmNamedColorNotFound        = -4216;                        {  NamedColor not found  }
  127.     cmCantGamutCheckError        = -4217;                        {  Gammut checking not supported by this ColorWorld  }
  128. {  deviceType values for ColorSync 1.0 Device Profile access  }
  129.     cmSystemDevice                = 'sys ';
  130.     cmGDevice                    = 'gdev';
  131. {  Commands for CMFlattenUPP(…)  }
  132.     cmOpenReadSpool                = 1;
  133.     cmOpenWriteSpool            = 2;
  134.     cmReadSpool                    = 3;
  135.     cmWriteSpool                = 4;
  136.     cmCloseSpool                = 5;
  137. {  Flags for PostScript-related functions  }
  138.     cmPS7bit                    = 1;
  139.     cmPS8bit                    = 2;
  140. {  Flags for profile embedding functions  }
  141.     cmEmbedWholeProfile            = $00000000;
  142.     cmEmbedProfileIdentifier    = $00000001;
  143. {  Commands for CMAccessUPP(…)  }
  144.     cmOpenReadAccess            = 1;
  145.     cmOpenWriteAccess            = 2;
  146.     cmReadAccess                = 3;
  147.     cmWriteAccess                = 4;
  148.     cmCloseAccess                = 5;
  149.     cmCreateNewAccess            = 6;
  150.     cmAbortWriteAccess            = 7;
  151.     cmBeginAccess                = 8;
  152.     cmEndAccess                    = 9;
  153. {  Abstract data type for memory-based Profile  }
  154.  
  155. TYPE
  156.     CMProfileRef                        = Ptr;
  157. {  Abstract data type for Profile search result  }
  158.     CMProfileSearchRef                    = Ptr;
  159. {  Abstract data type for BeginMatching(…) reference  }
  160.     CMMatchRef                            = Ptr;
  161. {  Abstract data type for ColorWorld reference  }
  162.     CMWorldRef                            = Ptr;
  163. {  Caller-supplied flatten function  }
  164.     CMFlattenProcPtr = ProcPtr;  { FUNCTION CMFlatten(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr; }
  165.  
  166. {  Caller-supplied progress function for Bitmap & PixMap matching routines  }
  167.     CMBitmapCallBackProcPtr = ProcPtr;  { FUNCTION CMBitmapCallBack(progress: LONGINT; refCon: UNIV Ptr): BOOLEAN; }
  168.  
  169. {  Caller-supplied filter function for Profile search  }
  170.     CMProfileFilterProcPtr = ProcPtr;  { FUNCTION CMProfileFilter(prof: CMProfileRef; refCon: UNIV Ptr): BOOLEAN; }
  171.  
  172. {  Caller-supplied function for profile access  }
  173.     CMProfileAccessProcPtr = ProcPtr;  { FUNCTION CMProfileAccess(command: LONGINT; offset: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr; }
  174.  
  175.     CMFlattenUPP = UniversalProcPtr;
  176.     CMBitmapCallBackUPP = UniversalProcPtr;
  177.     CMProfileFilterUPP = UniversalProcPtr;
  178.     CMProfileAccessUPP = UniversalProcPtr;
  179.  
  180. CONST
  181.     uppCMFlattenProcInfo = $00003FE0;
  182.     uppCMBitmapCallBackProcInfo = $000003D0;
  183.     uppCMProfileFilterProcInfo = $000003D0;
  184.     uppCMProfileAccessProcInfo = $0000FFE0;
  185.  
  186. FUNCTION NewCMFlattenProc(userRoutine: CMFlattenProcPtr): CMFlattenUPP;
  187.     {$IFC NOT GENERATINGCFM }
  188.     INLINE $2E9F;
  189.     {$ENDC}
  190.  
  191. FUNCTION NewCMBitmapCallBackProc(userRoutine: CMBitmapCallBackProcPtr): CMBitmapCallBackUPP;
  192.     {$IFC NOT GENERATINGCFM }
  193.     INLINE $2E9F;
  194.     {$ENDC}
  195.  
  196. FUNCTION NewCMProfileFilterProc(userRoutine: CMProfileFilterProcPtr): CMProfileFilterUPP;
  197.     {$IFC NOT GENERATINGCFM }
  198.     INLINE $2E9F;
  199.     {$ENDC}
  200.  
  201. FUNCTION NewCMProfileAccessProc(userRoutine: CMProfileAccessProcPtr): CMProfileAccessUPP;
  202.     {$IFC NOT GENERATINGCFM }
  203.     INLINE $2E9F;
  204.     {$ENDC}
  205.  
  206. FUNCTION CallCMFlattenProc(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMFlattenUPP): OSErr;
  207.     {$IFC NOT GENERATINGCFM}
  208.     INLINE $205F, $4E90;
  209.     {$ENDC}
  210.  
  211. FUNCTION CallCMBitmapCallBackProc(progress: LONGINT; refCon: UNIV Ptr; userRoutine: CMBitmapCallBackUPP): BOOLEAN;
  212.     {$IFC NOT GENERATINGCFM}
  213.     INLINE $205F, $4E90;
  214.     {$ENDC}
  215.  
  216. FUNCTION CallCMProfileFilterProc(prof: CMProfileRef; refCon: UNIV Ptr; userRoutine: CMProfileFilterUPP): BOOLEAN;
  217.     {$IFC NOT GENERATINGCFM}
  218.     INLINE $205F, $4E90;
  219.     {$ENDC}
  220.  
  221. FUNCTION CallCMProfileAccessProc(command: LONGINT; offset: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMProfileAccessUPP): OSErr;
  222.     {$IFC NOT GENERATINGCFM}
  223.     INLINE $205F, $4E90;
  224.     {$ENDC}
  225.  
  226. TYPE
  227.     CMError                                = LONGINT;
  228. {  For 1.0 and 2.0 profile header variants  }
  229. {  CMAppleProfileHeader  }
  230.     CMAppleProfileHeaderPtr = ^CMAppleProfileHeader;
  231.     CMAppleProfileHeader = RECORD
  232.         CASE INTEGER OF
  233.         0: (
  234.             cm1:                CMHeader;
  235.             );
  236.         1: (
  237.             cm2:                CM2Header;
  238.             );
  239.     END;
  240.  
  241. {  Param for CWConcatColorWorld(…)  }
  242.     CMConcatProfileSetPtr = ^CMConcatProfileSet;
  243.     CMConcatProfileSet = RECORD
  244.         keyIndex:                INTEGER;                                {  Zero-based  }
  245.         count:                    INTEGER;                                {  Min 1  }
  246.         profileSet:                ARRAY [0..0] OF CMProfileRef;            {  Variable. Ordered from Source -> Dest  }
  247.     END;
  248.  
  249. {  ColorSync color data types  }
  250.     CMRGBColorPtr = ^CMRGBColor;
  251.     CMRGBColor = RECORD
  252.         red:                    INTEGER;                                {  0..65535  }
  253.         green:                    INTEGER;
  254.         blue:                    INTEGER;
  255.     END;
  256.  
  257.     CMCMYKColorPtr = ^CMCMYKColor;
  258.     CMCMYKColor = RECORD
  259.         cyan:                    INTEGER;                                {  0..65535  }
  260.         magenta:                INTEGER;
  261.         yellow:                    INTEGER;
  262.         black:                    INTEGER;
  263.     END;
  264.  
  265.     CMCMYColorPtr = ^CMCMYColor;
  266.     CMCMYColor = RECORD
  267.         cyan:                    INTEGER;                                {  0..65535  }
  268.         magenta:                INTEGER;
  269.         yellow:                    INTEGER;
  270.     END;
  271.  
  272.     CMHLSColorPtr = ^CMHLSColor;
  273.     CMHLSColor = RECORD
  274.         hue:                    INTEGER;                                {  0..65535. Fraction of circle. Red at 0  }
  275.         lightness:                INTEGER;                                {  0..65535  }
  276.         saturation:                INTEGER;                                {  0..65535  }
  277.     END;
  278.  
  279.     CMHSVColorPtr = ^CMHSVColor;
  280.     CMHSVColor = RECORD
  281.         hue:                    INTEGER;                                {  0..65535. Fraction of circle. Red at 0  }
  282.         saturation:                INTEGER;                                {  0..65535  }
  283.         value:                    INTEGER;                                {  0..65535  }
  284.     END;
  285.  
  286.     CMLabColorPtr = ^CMLabColor;
  287.     CMLabColor = RECORD
  288.         L:                        INTEGER;                                {  0..65535 maps to 0..100  }
  289.         a:                        INTEGER;                                {  0..65535 maps to -128..127.996  }
  290.         b:                        INTEGER;                                {  0..65535 maps to -128..127.996  }
  291.     END;
  292.  
  293.     CMLuvColorPtr = ^CMLuvColor;
  294.     CMLuvColor = RECORD
  295.         L:                        INTEGER;                                {  0..65535 maps to 0..100  }
  296.         u:                        INTEGER;                                {  0..65535 maps to -128..127.996  }
  297.         v:                        INTEGER;                                {  0..65535 maps to -128..127.996  }
  298.     END;
  299.  
  300.     CMYxyColorPtr = ^CMYxyColor;
  301.     CMYxyColor = RECORD
  302.         capY:                    INTEGER;                                {  0..65535 maps to 0..1  }
  303.         x:                        INTEGER;                                {  0..65535 maps to 0..1  }
  304.         y:                        INTEGER;                                {  0..65535 maps to 0..1  }
  305.     END;
  306.  
  307.     CMGrayColorPtr = ^CMGrayColor;
  308.     CMGrayColor = RECORD
  309.         gray:                    INTEGER;                                {  0..65535  }
  310.     END;
  311.  
  312.     CMMultichannel5ColorPtr = ^CMMultichannel5Color;
  313.     CMMultichannel5Color = RECORD
  314.         components:                PACKED ARRAY [0..4] OF UInt8;            {  0..255  }
  315.     END;
  316.  
  317.     CMMultichannel6ColorPtr = ^CMMultichannel6Color;
  318.     CMMultichannel6Color = RECORD
  319.         components:                PACKED ARRAY [0..5] OF UInt8;            {  0..255  }
  320.     END;
  321.  
  322.     CMMultichannel7ColorPtr = ^CMMultichannel7Color;
  323.     CMMultichannel7Color = RECORD
  324.         components:                PACKED ARRAY [0..6] OF UInt8;            {  0..255  }
  325.     END;
  326.  
  327.     CMMultichannel8ColorPtr = ^CMMultichannel8Color;
  328.     CMMultichannel8Color = RECORD
  329.         components:                PACKED ARRAY [0..7] OF UInt8;            {  0..255  }
  330.     END;
  331.  
  332.     CMNamedColorPtr = ^CMNamedColor;
  333.     CMNamedColor = RECORD
  334.         namedColorIndex:        LONGINT;                                {  0..a lot  }
  335.     END;
  336.  
  337.     CMColorPtr = ^CMColor;
  338.     CMColor = RECORD
  339.         CASE INTEGER OF
  340.         0: (
  341.             rgb:                CMRGBColor;
  342.             );
  343.         1: (
  344.             hsv:                CMHSVColor;
  345.             );
  346.         2: (
  347.             hls:                CMHLSColor;
  348.             );
  349.         3: (
  350.             XYZ:                CMXYZColor;
  351.             );
  352.         4: (
  353.             Lab:                CMLabColor;
  354.             );
  355.         5: (
  356.             Luv:                CMLuvColor;
  357.             );
  358.         6: (
  359.             Yxy:                CMYxyColor;
  360.             );
  361.         7: (
  362.             cmyk:                CMCMYKColor;
  363.             );
  364.         8: (
  365.             cmy:                CMCMYColor;
  366.             );
  367.         9: (
  368.             gray:                CMGrayColor;
  369.             );
  370.         10: (
  371.             mc5:                CMMultichannel5Color;
  372.             );
  373.         11: (
  374.             mc6:                CMMultichannel6Color;
  375.             );
  376.         12: (
  377.             mc7:                CMMultichannel7Color;
  378.             );
  379.         13: (
  380.             mc8:                CMMultichannel8Color;
  381.             );
  382.         14: (
  383.             namedColor:            CMNamedColor;
  384.             );
  385.     END;
  386.  
  387.     CMProfileSearchRecordPtr = ^CMProfileSearchRecord;
  388.     CMProfileSearchRecord = RECORD
  389.         header:                    CMHeader;
  390.         fieldMask:                LONGINT;
  391.         reserved:                ARRAY [0..1] OF LONGINT;
  392.     END;
  393.  
  394.     CMProfileSearchRecordHandle            = ^CMProfileSearchRecordPtr;
  395. {  Search definition for 2.0  }
  396.     CMSearchRecordPtr = ^CMSearchRecord;
  397.     CMSearchRecord = RECORD
  398.         CMMType:                OSType;
  399.         profileClass:            OSType;
  400.         dataColorSpace:            OSType;
  401.         profileConnectionSpace:    OSType;
  402.         deviceManufacturer:        LONGINT;
  403.         deviceModel:            LONGINT;
  404.         deviceAttributes:        ARRAY [0..1] OF LONGINT;
  405.         profileFlags:            LONGINT;
  406.         searchMask:                LONGINT;
  407.         filter:                    CMProfileFilterUPP;
  408.     END;
  409.  
  410. {  GetCWInfo structures  }
  411.     CMMInfoRecordPtr = ^CMMInfoRecord;
  412.     CMMInfoRecord = RECORD
  413.         CMMType:                OSType;
  414.         CMMVersion:                LONGINT;
  415.     END;
  416.  
  417.     CMCWInfoRecordPtr = ^CMCWInfoRecord;
  418.     CMCWInfoRecord = RECORD
  419.         cmmCount:                LONGINT;
  420.         cmmInfo:                ARRAY [0..1] OF CMMInfoRecord;
  421.     END;
  422.  
  423. {  profile identifier structures  }
  424.     CMProfileIdentifierPtr = ^CMProfileIdentifier;
  425.     CMProfileIdentifier = RECORD
  426.         profileHeader:            CM2Header;
  427.         calibrationDate:        CMDateTime;
  428.         ASCIIProfileDescriptionLen: LONGINT;
  429.         ASCIIProfileDescription: SInt8;                                    {  variable length  }
  430.     END;
  431.  
  432. {  packing formats  }
  433.  
  434. CONST
  435.     cmNoColorPacking            = $0000;
  436.     cmAlphaSpace                = $0080;
  437.     cmWord5ColorPacking            = $0500;
  438.     cmLong8ColorPacking            = $0800;
  439.     cmLong10ColorPacking        = $0A00;
  440.     cmAlphaFirstPacking            = $1000;
  441.     cmOneBitDirectPacking        = $0B00;
  442.     cmAlphaLastPacking            = $0000;
  443.     cm24_8ColorPacking            = $2100;
  444.     cm32_8ColorPacking            = $0800;
  445.     cm40_8ColorPacking            = $2200;
  446.     cm48_8ColorPacking            = $2300;
  447.     cm56_8ColorPacking            = $2400;
  448.     cm64_8ColorPacking            = $2500;
  449.     cm32_16ColorPacking            = $2600;
  450.     cm32_32ColorPacking            = $2700;
  451. {  general colorspaces  }
  452.     cmNoSpace                    = 0;
  453.     cmRGBSpace                    = 1;
  454.     cmCMYKSpace                    = 2;
  455.     cmHSVSpace                    = 3;
  456.     cmHLSSpace                    = 4;
  457.     cmYXYSpace                    = 5;
  458.     cmXYZSpace                    = 6;
  459.     cmLUVSpace                    = 7;
  460.     cmLABSpace                    = 8;
  461.     cmReservedSpace1            = 9;
  462.     cmGraySpace                    = 10;
  463.     cmReservedSpace2            = 11;
  464.     cmGamutResultSpace            = 12;
  465.     cmNamedIndexedSpace            = 16;
  466.     cmMCFiveSpace                = 17;
  467.     cmMCSixSpace                = 18;
  468.     cmMCSevenSpace                = 19;
  469.     cmMCEightSpace                = 20;
  470. {  supported CMBitmapColorSpaces - each of the following is a  }
  471. {  combination of a general colospace and a packing formats  }
  472.     cmRGBASpace                    = 129;
  473.     cmGrayASpace                = 138;
  474.     cmRGB16Space                = $0501;
  475.     cmRGB32Space                = $0801;
  476.     cmARGB32Space                = $1881;
  477.     cmCMYK32Space                = $0802;
  478.     cmHSV32Space                = $0A03;
  479.     cmHLS32Space                = $0A04;
  480.     cmYXY32Space                = $0A05;
  481.     cmXYZ32Space                = $0A06;
  482.     cmLUV32Space                = $0A07;
  483.     cmLAB32Space                = $0A08;
  484.     cmGamutResult1Space            = $0B0C;
  485.     cmRGB24Space                = $2101;
  486.     cmRGBA32Space                = $0881;
  487.     cmLAB24Space                = $2108;
  488.     cmNamedIndexed32Space        = $2710;
  489.     cmMCFive8Space                = $2211;
  490.     cmMCSix8Space                = $2312;
  491.     cmMCSeven8Space                = $2413;
  492.     cmMCEight8Space                = $2514;
  493.  
  494. TYPE
  495.     CMBitmapColorSpace                    = LONGINT;
  496.     CMBitmapPtr = ^CMBitmap;
  497.     CMBitmap = RECORD
  498.         image:                    CStringPtr;
  499.         width:                    LONGINT;
  500.         height:                    LONGINT;
  501.         rowBytes:                LONGINT;
  502.         pixelSize:                LONGINT;
  503.         space:                    CMBitmapColorSpace;
  504.         user1:                    LONGINT;
  505.         user2:                    LONGINT;
  506.     END;
  507.  
  508. {  Classic Print Manager Stuff  }
  509.  
  510. CONST
  511.     enableColorMatchingOp        = 12;
  512.     registerProfileOp            = 13;
  513.     cmNoProfileBase                = 0;
  514.     cmFileBasedProfile            = 1;
  515.     cmHandleBasedProfile        = 2;
  516.     cmPtrBasedProfile            = 3;
  517.     cmProcedureBasedProfile        = 4;
  518.  
  519. TYPE
  520.     CMFileLocationPtr = ^CMFileLocation;
  521.     CMFileLocation = RECORD
  522.         spec:                    FSSpec;
  523.     END;
  524.  
  525.     CMHandleLocationPtr = ^CMHandleLocation;
  526.     CMHandleLocation = RECORD
  527.         h:                        Handle;
  528.     END;
  529.  
  530.     CMPtrLocationPtr = ^CMPtrLocation;
  531.     CMPtrLocation = RECORD
  532.         p:                        Ptr;
  533.     END;
  534.  
  535.     CMProcedureLocationPtr = ^CMProcedureLocation;
  536.     CMProcedureLocation = RECORD
  537.         proc:                    CMProfileAccessUPP;
  538.         refCon:                    Ptr;
  539.     END;
  540.  
  541.     CMProfLocPtr = ^CMProfLoc;
  542.     CMProfLoc = RECORD
  543.         CASE INTEGER OF
  544.         0: (
  545.             fileLoc:            CMFileLocation;
  546.             );
  547.         1: (
  548.             handleLoc:            CMHandleLocation;
  549.             );
  550.         2: (
  551.             ptrLoc:                CMPtrLocation;
  552.             );
  553.         3: (
  554.             procLoc:            CMProcedureLocation;
  555.             );
  556.     END;
  557.  
  558.     CMProfileLocationPtr = ^CMProfileLocation;
  559.     CMProfileLocation = RECORD
  560.         locType:                INTEGER;
  561.         u:                        CMProfLoc;
  562.     END;
  563.  
  564. {  Profile file and element access  }
  565. FUNCTION CMNewProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  566.     {$IFC NOT GENERATINGCFM}
  567.     INLINE $203C, $0008, $001B, $ABEE;
  568.     {$ENDC}
  569. FUNCTION CMOpenProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  570.     {$IFC NOT GENERATINGCFM}
  571.     INLINE $203C, $0008, $001C, $ABEE;
  572.     {$ENDC}
  573. FUNCTION CMCloseProfile(prof: CMProfileRef): CMError;
  574.     {$IFC NOT GENERATINGCFM}
  575.     INLINE $203C, $0004, $001D, $ABEE;
  576.     {$ENDC}
  577. FUNCTION CMUpdateProfile(prof: CMProfileRef): CMError;
  578.     {$IFC NOT GENERATINGCFM}
  579.     INLINE $203C, $0004, $0034, $ABEE;
  580.     {$ENDC}
  581. FUNCTION CMCopyProfile(VAR targetProf: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; srcProf: CMProfileRef): CMError;
  582.     {$IFC NOT GENERATINGCFM}
  583.     INLINE $203C, $000C, $0025, $ABEE;
  584.     {$ENDC}
  585. FUNCTION CMValidateProfile(prof: CMProfileRef; VAR valid: BOOLEAN; VAR preferredCMMnotfound: BOOLEAN): CMError;
  586.     {$IFC NOT GENERATINGCFM}
  587.     INLINE $203C, $000C, $0026, $ABEE;
  588.     {$ENDC}
  589. FUNCTION CMGetProfileLocation(prof: CMProfileRef; VAR theProfile: CMProfileLocation): CMError;
  590.     {$IFC NOT GENERATINGCFM}
  591.     INLINE $203C, $0008, $003C, $ABEE;
  592.     {$ENDC}
  593. FUNCTION CMFlattenProfile(prof: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  594.     {$IFC NOT GENERATINGCFM}
  595.     INLINE $203C, $0014, $0031, $ABEE;
  596.     {$ENDC}
  597. FUNCTION CMUnflattenProfile(VAR resultFileSpec: FSSpec; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  598.     {$IFC NOT GENERATINGCFM}
  599.     INLINE $203C, $0010, $0032, $ABEE;
  600.     {$ENDC}
  601. FUNCTION CMGetProfileHeader(prof: CMProfileRef; VAR header: CMAppleProfileHeader): CMError;
  602.     {$IFC NOT GENERATINGCFM}
  603.     INLINE $203C, $0008, $0039, $ABEE;
  604.     {$ENDC}
  605. FUNCTION CMSetProfileHeader(prof: CMProfileRef; {CONST}VAR header: CMAppleProfileHeader): CMError;
  606.     {$IFC NOT GENERATINGCFM}
  607.     INLINE $203C, $0008, $003A, $ABEE;
  608.     {$ENDC}
  609. FUNCTION CMProfileElementExists(prof: CMProfileRef; tag: OSType; VAR found: BOOLEAN): CMError;
  610.     {$IFC NOT GENERATINGCFM}
  611.     INLINE $203C, $000C, $001E, $ABEE;
  612.     {$ENDC}
  613. FUNCTION CMCountProfileElements(prof: CMProfileRef; VAR elementCount: LONGINT): CMError;
  614.     {$IFC NOT GENERATINGCFM}
  615.     INLINE $203C, $0008, $001F, $ABEE;
  616.     {$ENDC}
  617. FUNCTION CMGetProfileElement(prof: CMProfileRef; tag: OSType; VAR elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  618.     {$IFC NOT GENERATINGCFM}
  619.     INLINE $203C, $0010, $0020, $ABEE;
  620.     {$ENDC}
  621. FUNCTION CMSetProfileElement(prof: CMProfileRef; tag: OSType; elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  622.     {$IFC NOT GENERATINGCFM}
  623.     INLINE $203C, $0010, $0023, $ABEE;
  624.     {$ENDC}
  625. FUNCTION CMSetProfileElementSize(prof: CMProfileRef; tag: OSType; elementSize: LONGINT): CMError;
  626.     {$IFC NOT GENERATINGCFM}
  627.     INLINE $203C, $000C, $0038, $ABEE;
  628.     {$ENDC}
  629. FUNCTION CMSetProfileElementReference(prof: CMProfileRef; elementTag: OSType; referenceTag: OSType): CMError;
  630.     {$IFC NOT GENERATINGCFM}
  631.     INLINE $203C, $000C, $0035, $ABEE;
  632.     {$ENDC}
  633. FUNCTION CMGetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: LONGINT; VAR byteCount: LONGINT; elementData: UNIV Ptr): CMError;
  634.     {$IFC NOT GENERATINGCFM}
  635.     INLINE $203C, $0014, $0036, $ABEE;
  636.     {$ENDC}
  637. FUNCTION CMSetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: LONGINT; byteCount: LONGINT; elementData: UNIV Ptr): CMError;
  638.     {$IFC NOT GENERATINGCFM}
  639.     INLINE $203C, $0014, $0037, $ABEE;
  640.     {$ENDC}
  641. FUNCTION CMGetIndProfileElementInfo(prof: CMProfileRef; index: LONGINT; VAR tag: OSType; VAR elementSize: LONGINT; VAR refs: BOOLEAN): CMError;
  642.     {$IFC NOT GENERATINGCFM}
  643.     INLINE $203C, $0014, $0021, $ABEE;
  644.     {$ENDC}
  645. FUNCTION CMGetIndProfileElement(prof: CMProfileRef; index: LONGINT; VAR elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  646.     {$IFC NOT GENERATINGCFM}
  647.     INLINE $203C, $0010, $0022, $ABEE;
  648.     {$ENDC}
  649. FUNCTION CMRemoveProfileElement(prof: CMProfileRef; tag: OSType): CMError;
  650.     {$IFC NOT GENERATINGCFM}
  651.     INLINE $203C, $0008, $0024, $ABEE;
  652.     {$ENDC}
  653. FUNCTION CMGetScriptProfileDescription(prof: CMProfileRef; VAR name: Str255; VAR code: ScriptCode): CMError;
  654.     {$IFC NOT GENERATINGCFM}
  655.     INLINE $203C, $000C, $003E, $ABEE;
  656.     {$ENDC}
  657. FUNCTION CMCloneProfileRef(prof: CMProfileRef): CMError;
  658.     {$IFC NOT GENERATINGCFM}
  659.     INLINE $203C, $0004, $0042, $ABEE;
  660.     {$ENDC}
  661. FUNCTION CMGetProfileRefCount(prof: CMProfileRef; VAR count: LONGINT): CMError;
  662.     {$IFC NOT GENERATINGCFM}
  663.     INLINE $203C, $0008, $0043, $ABEE;
  664.     {$ENDC}
  665. FUNCTION CMProfileModified(prof: CMProfileRef; VAR modified: BOOLEAN): CMError;
  666.     {$IFC NOT GENERATINGCFM}
  667.     INLINE $203C, $0008, $0044, $ABEE;
  668.     {$ENDC}
  669. {  named Color access functions  }
  670. FUNCTION CMGetNamedColorInfo(prof: CMProfileRef; VAR deviceChannels: LONGINT; VAR deviceColorSpace: OSType; VAR PCSColorSpace: OSType; VAR count: LONGINT; prefix: StringPtr; suffix: StringPtr): CMError;
  671.     {$IFC NOT GENERATINGCFM}
  672.     INLINE $203C, $001C, $0046, $ABEE;
  673.     {$ENDC}
  674. FUNCTION CMGetNamedColorValue(prof: CMProfileRef; name: StringPtr; VAR deviceColor: CMColor; VAR PCSColor: CMColor): CMError;
  675.     {$IFC NOT GENERATINGCFM}
  676.     INLINE $203C, $0010, $0047, $ABEE;
  677.     {$ENDC}
  678. FUNCTION CMGetIndNamedColorValue(prof: CMProfileRef; index: LONGINT; VAR deviceColor: CMColor; VAR PCSColor: CMColor): CMError;
  679.     {$IFC NOT GENERATINGCFM}
  680.     INLINE $203C, $0010, $0048, $ABEE;
  681.     {$ENDC}
  682. FUNCTION CMGetNamedColorIndex(prof: CMProfileRef; name: StringPtr; VAR index: LONGINT): CMError;
  683.     {$IFC NOT GENERATINGCFM}
  684.     INLINE $203C, $000C, $0049, $ABEE;
  685.     {$ENDC}
  686. FUNCTION CMGetNamedColorName(prof: CMProfileRef; index: LONGINT; name: StringPtr): CMError;
  687.     {$IFC NOT GENERATINGCFM}
  688.     INLINE $203C, $000C, $004A, $ABEE;
  689.     {$ENDC}
  690. {  Low-level matching functions  }
  691. FUNCTION NCWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileRef; dst: CMProfileRef): CMError;
  692.     {$IFC NOT GENERATINGCFM}
  693.     INLINE $203C, $000C, $0014, $ABEE;
  694.     {$ENDC}
  695. FUNCTION CWConcatColorWorld(VAR cw: CMWorldRef; VAR profileSet: CMConcatProfileSet): CMError;
  696.     {$IFC NOT GENERATINGCFM}
  697.     INLINE $203C, $0008, $0015, $ABEE;
  698.     {$ENDC}
  699. FUNCTION CWNewLinkProfile(VAR prof: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; VAR profileSet: CMConcatProfileSet): CMError;
  700.     {$IFC NOT GENERATINGCFM}
  701.     INLINE $203C, $000C, $0033, $ABEE;
  702.     {$ENDC}
  703. PROCEDURE CWDisposeColorWorld(cw: CMWorldRef);
  704.     {$IFC NOT GENERATINGCFM}
  705.     INLINE $203C, $0004, $0001, $ABEE;
  706.     {$ENDC}
  707. FUNCTION CWMatchColors(cw: CMWorldRef; VAR myColors: CMColor; count: LONGINT): CMError;
  708.     {$IFC NOT GENERATINGCFM}
  709.     INLINE $203C, $000C, $0002, $ABEE;
  710.     {$ENDC}
  711. FUNCTION CWCheckColors(cw: CMWorldRef; VAR myColors: CMColor; count: LONGINT; VAR result: LONGINT): CMError;
  712.     {$IFC NOT GENERATINGCFM}
  713.     INLINE $203C, $0010, $0003, $ABEE;
  714.     {$ENDC}
  715. {  Bitmap matching  }
  716. FUNCTION CWMatchBitmap(cw: CMWorldRef; VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR matchedBitmap: CMBitmap): CMError;
  717.     {$IFC NOT GENERATINGCFM}
  718.     INLINE $203C, $0010, $002C, $ABEE;
  719.     {$ENDC}
  720. FUNCTION CWCheckBitmap(cw: CMWorldRef; {CONST}VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitmap: CMBitmap): CMError;
  721.     {$IFC NOT GENERATINGCFM}
  722.     INLINE $203C, $0014, $002D, $ABEE;
  723.     {$ENDC}
  724. {  Quickdraw-specific matching  }
  725. FUNCTION CWMatchPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr): CMError;
  726.     {$IFC NOT GENERATINGCFM}
  727.     INLINE $203C, $0010, $0004, $ABEE;
  728.     {$ENDC}
  729. FUNCTION CWCheckPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitMap: BitMap): CMError;
  730.     {$IFC NOT GENERATINGCFM}
  731.     INLINE $203C, $0014, $0007, $ABEE;
  732.     {$ENDC}
  733. FUNCTION NCMBeginMatching(src: CMProfileRef; dst: CMProfileRef; VAR myRef: CMMatchRef): CMError;
  734.     {$IFC NOT GENERATINGCFM}
  735.     INLINE $203C, $000C, $0016, $ABEE;
  736.     {$ENDC}
  737. PROCEDURE CMEndMatching(myRef: CMMatchRef);
  738.     {$IFC NOT GENERATINGCFM}
  739.     INLINE $203C, $0004, $000B, $ABEE;
  740.     {$ENDC}
  741. PROCEDURE NCMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileRef; VAR myRect: Rect);
  742.     {$IFC NOT GENERATINGCFM}
  743.     INLINE $203C, $000C, $0017, $ABEE;
  744.     {$ENDC}
  745. PROCEDURE CMEnableMatchingComment(enableIt: BOOLEAN);
  746.     {$IFC NOT GENERATINGCFM}
  747.     INLINE $203C, $0002, $000D, $ABEE;
  748.     {$ENDC}
  749. FUNCTION NCMUseProfileComment(prof: CMProfileRef; flags: LONGINT): CMError;
  750.     {$IFC NOT GENERATINGCFM}
  751.     INLINE $203C, $0008, $003B, $ABEE;
  752.     {$ENDC}
  753. FUNCTION CMCreateProfileIdentifier(prof: CMProfileRef; ident: CMProfileIdentifierPtr; VAR size: LONGINT): CMError;
  754.     {$IFC NOT GENERATINGCFM}
  755.     INLINE $203C, $000C, $0041, $ABEE;
  756.     {$ENDC}
  757. {  System Profile access  }
  758. FUNCTION CMGetSystemProfile(VAR prof: CMProfileRef): CMError;
  759.     {$IFC NOT GENERATINGCFM}
  760.     INLINE $203C, $0004, $0018, $ABEE;
  761.     {$ENDC}
  762. FUNCTION CMSetSystemProfile({CONST}VAR profileFileSpec: FSSpec): CMError;
  763.     {$IFC NOT GENERATINGCFM}
  764.     INLINE $203C, $0004, $0019, $ABEE;
  765.     {$ENDC}
  766. {  External Profile Management  }
  767. FUNCTION CMNewProfileSearch(VAR searchSpec: CMSearchRecord; refCon: UNIV Ptr; VAR count: LONGINT; VAR searchResult: CMProfileSearchRef): CMError;
  768.     {$IFC NOT GENERATINGCFM}
  769.     INLINE $203C, $0010, $0027, $ABEE;
  770.     {$ENDC}
  771. FUNCTION CMUpdateProfileSearch(search: CMProfileSearchRef; refCon: UNIV Ptr; VAR count: LONGINT): CMError;
  772.     {$IFC NOT GENERATINGCFM}
  773.     INLINE $203C, $000C, $0028, $ABEE;
  774.     {$ENDC}
  775. PROCEDURE CMDisposeProfileSearch(search: CMProfileSearchRef);
  776.     {$IFC NOT GENERATINGCFM}
  777.     INLINE $203C, $0004, $0029, $ABEE;
  778.     {$ENDC}
  779. FUNCTION CMSearchGetIndProfile(search: CMProfileSearchRef; index: LONGINT; VAR prof: CMProfileRef): CMError;
  780.     {$IFC NOT GENERATINGCFM}
  781.     INLINE $203C, $000C, $002A, $ABEE;
  782.     {$ENDC}
  783. FUNCTION CMSearchGetIndProfileFileSpec(search: CMProfileSearchRef; index: LONGINT; VAR profileFile: FSSpec): CMError;
  784.     {$IFC NOT GENERATINGCFM}
  785.     INLINE $203C, $000C, $002B, $ABEE;
  786.     {$ENDC}
  787. FUNCTION CMProfileIdentifierFolderSearch(ident: CMProfileIdentifierPtr; VAR matchedCount: LONGINT; VAR searchResult: CMProfileSearchRef): CMError;
  788.     {$IFC NOT GENERATINGCFM}
  789.     INLINE $203C, $000C, $003F, $ABEE;
  790.     {$ENDC}
  791. FUNCTION CMProfileIdentifierListSearch(ident: CMProfileIdentifierPtr; VAR profileList: CMProfileRef; listSize: LONGINT; VAR matchedCount: LONGINT; VAR matchedList: CMProfileRef): CMError;
  792.     {$IFC NOT GENERATINGCFM}
  793.     INLINE $203C, $0014, $0040, $ABEE;
  794.     {$ENDC}
  795. {  Utilities  }
  796. FUNCTION CMGetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  797.     {$IFC NOT GENERATINGCFM}
  798.     INLINE $203C, $000C, $0011, $ABEE;
  799.     {$ENDC}
  800. FUNCTION CMGetCWInfo(cw: CMWorldRef; VAR info: CMCWInfoRecord): CMError;
  801.     {$IFC NOT GENERATINGCFM}
  802.     INLINE $203C, $0008, $001A, $ABEE;
  803.     {$ENDC}
  804. FUNCTION CMConvertProfile2to1(profv2: CMProfileRef; VAR profv1: CMProfileHandle): CMError;
  805.     {$IFC NOT GENERATINGCFM}
  806.     INLINE $203C, $0008, $0045, $ABEE;
  807.     {$ENDC}
  808. {  ColorSpace conversion functions  }
  809. FUNCTION CMConvertXYZToLab({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: LONGINT): CMError;
  810.     {$IFC NOT GENERATINGCFM}
  811.     INLINE $203C, $0010, $004B, $ABEE;
  812.     {$ENDC}
  813. FUNCTION CMConvertLabToXYZ({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: LONGINT): CMError;
  814.     {$IFC NOT GENERATINGCFM}
  815.     INLINE $203C, $0010, $004C, $ABEE;
  816.     {$ENDC}
  817. FUNCTION CMConvertXYZToLuv({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: LONGINT): CMError;
  818.     {$IFC NOT GENERATINGCFM}
  819.     INLINE $203C, $0010, $004D, $ABEE;
  820.     {$ENDC}
  821. FUNCTION CMConvertLuvToXYZ({CONST}VAR src: CMColor; {CONST}VAR white: CMXYZColor; VAR dst: CMColor; count: LONGINT): CMError;
  822.     {$IFC NOT GENERATINGCFM}
  823.     INLINE $203C, $0010, $004E, $ABEE;
  824.     {$ENDC}
  825. FUNCTION CMConvertXYZToYxy({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  826.     {$IFC NOT GENERATINGCFM}
  827.     INLINE $203C, $000C, $004F, $ABEE;
  828.     {$ENDC}
  829. FUNCTION CMConvertYxyToXYZ({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  830.     {$IFC NOT GENERATINGCFM}
  831.     INLINE $203C, $000C, $0050, $ABEE;
  832.     {$ENDC}
  833. FUNCTION CMConvertRGBToHLS({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  834.     {$IFC NOT GENERATINGCFM}
  835.     INLINE $203C, $000C, $0051, $ABEE;
  836.     {$ENDC}
  837. FUNCTION CMConvertHLSToRGB({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  838.     {$IFC NOT GENERATINGCFM}
  839.     INLINE $203C, $000C, $0052, $ABEE;
  840.     {$ENDC}
  841. FUNCTION CMConvertRGBToHSV({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  842.     {$IFC NOT GENERATINGCFM}
  843.     INLINE $203C, $000C, $0053, $ABEE;
  844.     {$ENDC}
  845. FUNCTION CMConvertHSVToRGB({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  846.     {$IFC NOT GENERATINGCFM}
  847.     INLINE $203C, $000C, $0054, $ABEE;
  848.     {$ENDC}
  849. FUNCTION CMConvertRGBToGray({CONST}VAR src: CMColor; VAR dst: CMColor; count: LONGINT): CMError;
  850.     {$IFC NOT GENERATINGCFM}
  851.     INLINE $203C, $000C, $0055, $ABEE;
  852.     {$ENDC}
  853. FUNCTION CMConvertXYZToFixedXYZ({CONST}VAR src: CMXYZColor; VAR dst: CMFixedXYZColor; count: LONGINT): CMError;
  854.     {$IFC NOT GENERATINGCFM}
  855.     INLINE $203C, $000C, $0056, $ABEE;
  856.     {$ENDC}
  857. FUNCTION CMConvertFixedXYZToXYZ({CONST}VAR src: CMFixedXYZColor; VAR dst: CMXYZColor; count: LONGINT): CMError;
  858.     {$IFC NOT GENERATINGCFM}
  859.     INLINE $203C, $000C, $0057, $ABEE;
  860.     {$ENDC}
  861. {  PS-related  }
  862. FUNCTION CMGetPS2ColorSpace(srcProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  863.     {$IFC NOT GENERATINGCFM}
  864.     INLINE $203C, $0014, $002E, $ABEE;
  865.     {$ENDC}
  866. FUNCTION CMGetPS2ColorRenderingIntent(srcProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  867.     {$IFC NOT GENERATINGCFM}
  868.     INLINE $203C, $0014, $002F, $ABEE;
  869.     {$ENDC}
  870. FUNCTION CMGetPS2ColorRendering(srcProf: CMProfileRef; dstProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  871.     {$IFC NOT GENERATINGCFM}
  872.     INLINE $203C, $0018, $0030, $ABEE;
  873.     {$ENDC}
  874. FUNCTION CMGetPS2ColorRenderingVMSize(srcProf: CMProfileRef; dstProf: CMProfileRef; VAR vmSize: LONGINT; VAR preferredCMMnotfound: BOOLEAN): CMError;
  875.     {$IFC NOT GENERATINGCFM}
  876.     INLINE $203C, $0010, $003D, $ABEE;
  877.     {$ENDC}
  878. {  ColorSync 1.0 functions which have parallel 2.0 counterparts  }
  879. FUNCTION CWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileHandle; dst: CMProfileHandle): CMError;
  880.     {$IFC NOT GENERATINGCFM}
  881.     INLINE $203C, $000C, $0000, $ABEE;
  882.     {$ENDC}
  883. FUNCTION ConcatenateProfiles(thru: CMProfileHandle; dst: CMProfileHandle; VAR newDst: CMProfileHandle): CMError;
  884.     {$IFC NOT GENERATINGCFM}
  885.     INLINE $203C, $000C, $000C, $ABEE;
  886.     {$ENDC}
  887. FUNCTION CMBeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  888.     {$IFC NOT GENERATINGCFM}
  889.     INLINE $203C, $000C, $000A, $ABEE;
  890.     {$ENDC}
  891. PROCEDURE CMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  892.     {$IFC NOT GENERATINGCFM}
  893.     INLINE $203C, $000C, $0009, $ABEE;
  894.     {$ENDC}
  895. FUNCTION CMUseProfileComment(profile: CMProfileHandle): CMError;
  896.     {$IFC NOT GENERATINGCFM}
  897.     INLINE $203C, $0004, $0008, $ABEE;
  898.     {$ENDC}
  899. PROCEDURE CMGetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  900.     {$IFC NOT GENERATINGCFM}
  901.     INLINE $203C, $0008, $000E, $ABEE;
  902.     {$ENDC}
  903. FUNCTION CMGetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  904.     {$IFC NOT GENERATINGCFM}
  905.     INLINE $203C, $0004, $000F, $ABEE;
  906.     {$ENDC}
  907. {  ProfileResponder functions  }
  908. FUNCTION GetProfile(deviceType: OSType; refNum: LONGINT; aProfile: CMProfileHandle; VAR returnedProfile: CMProfileHandle): CMError;
  909.     {$IFC NOT GENERATINGCFM}
  910.     INLINE $203C, $0010, $0005, $ABEE;
  911.     {$ENDC}
  912. FUNCTION SetProfile(deviceType: OSType; refNum: LONGINT; newProfile: CMProfileHandle): CMError;
  913.     {$IFC NOT GENERATINGCFM}
  914.     INLINE $203C, $000C, $0006, $ABEE;
  915.     {$ENDC}
  916. FUNCTION SetProfileDescription(deviceType: OSType; refNum: LONGINT; deviceData: LONGINT; hProfile: CMProfileHandle): CMError;
  917.     {$IFC NOT GENERATINGCFM}
  918.     INLINE $203C, $0010, $0010, $ABEE;
  919.     {$ENDC}
  920. FUNCTION GetIndexedProfile(deviceType: OSType; refNum: LONGINT; search: CMProfileSearchRecordHandle; VAR returnProfile: CMProfileHandle; VAR index: LONGINT): CMError;
  921.     {$IFC NOT GENERATINGCFM}
  922.     INLINE $203C, $0014, $0012, $ABEE;
  923.     {$ENDC}
  924. FUNCTION DeleteDeviceProfile(deviceType: OSType; refNum: LONGINT; deleteMe: CMProfileHandle): CMError;
  925.     {$IFC NOT GENERATINGCFM}
  926.     INLINE $203C, $000C, $0013, $ABEE;
  927.     {$ENDC}
  928. {$IFC OLDROUTINENAMES }
  929. {  constants  }
  930.  
  931. CONST
  932.     kMatchCMMType                = $00000001;
  933.     kMatchApplProfileVersion    = $00000002;
  934.     kMatchDataType                = $00000004;
  935.     kMatchDeviceType            = $00000008;
  936.     kMatchDeviceManufacturer    = $00000010;
  937.     kMatchDeviceModel            = $00000020;
  938.     kMatchDeviceAttributes        = $00000040;
  939.     kMatchFlags                    = $00000080;
  940.     kMatchOptions                = $00000100;
  941.     kMatchWhite                    = $00000200;
  942.     kMatchBlack                    = $00000400;
  943. {  types  }
  944.  
  945. TYPE
  946.     CMYKColor                            = CMCMYKColor;
  947.     CWorld                                = CMWorldRef;
  948.     CMGamutResult                        = ^LONGINT;
  949. {  functions  }
  950. PROCEDURE EndMatching(myRef: CMMatchRef);
  951.     {$IFC NOT GENERATINGCFM}
  952.     INLINE $203C, $0004, $000B, $ABEE;
  953.     {$ENDC}
  954. PROCEDURE EnableMatching(enableIt: BOOLEAN);
  955.     {$IFC NOT GENERATINGCFM}
  956.     INLINE $203C, $0002, $000D, $ABEE;
  957.     {$ENDC}
  958. FUNCTION GetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  959.     {$IFC NOT GENERATINGCFM}
  960.     INLINE $203C, $000C, $0011, $ABEE;
  961.     {$ENDC}
  962. FUNCTION BeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  963.     {$IFC NOT GENERATINGCFM}
  964.     INLINE $203C, $000C, $000A, $ABEE;
  965.     {$ENDC}
  966. PROCEDURE DrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  967.     {$IFC NOT GENERATINGCFM}
  968.     INLINE $203C, $000C, $0009, $ABEE;
  969.     {$ENDC}
  970. FUNCTION UseProfile(profile: CMProfileHandle): CMError;
  971.     {$IFC NOT GENERATINGCFM}
  972.     INLINE $203C, $0004, $0008, $ABEE;
  973.     {$ENDC}
  974. PROCEDURE GetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  975.     {$IFC NOT GENERATINGCFM}
  976.     INLINE $203C, $0008, $000E, $ABEE;
  977.     {$ENDC}
  978. FUNCTION GetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  979.     {$IFC NOT GENERATINGCFM}
  980.     INLINE $203C, $0004, $000F, $ABEE;
  981.     {$ENDC}
  982. {$ENDC}
  983.  
  984. {  PrGeneral parameter blocks  }
  985. TYPE
  986.     TEnableColorMatchingBlkPtr = ^TEnableColorMatchingBlk;
  987.     TEnableColorMatchingBlk = RECORD
  988.         iOpCode:                INTEGER;
  989.         iError:                    INTEGER;
  990.         lReserved:                LONGINT;
  991.         hPrint:                    THPrint;
  992.         fEnableIt:                BOOLEAN;
  993.         filler:                    SInt8;
  994.     END;
  995.  
  996.     TRegisterProfileBlkPtr = ^TRegisterProfileBlk;
  997.     TRegisterProfileBlk = RECORD
  998.         iOpCode:                INTEGER;
  999.         iError:                    INTEGER;
  1000.         lReserved:                LONGINT;
  1001.         hPrint:                    THPrint;
  1002.         fRegisterIt:            BOOLEAN;
  1003.         filler:                    SInt8;
  1004.     END;
  1005.  
  1006. {$ALIGN RESET}
  1007. {$POP}
  1008.  
  1009. {$SETC UsingIncludes := CMApplicationIncludes}
  1010.  
  1011. {$ENDC} {__CMAPPLICATION__}
  1012.  
  1013. {$IFC NOT UsingIncludes}
  1014.  END.
  1015. {$ENDC}
  1016.